<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$return['ischecklogin']=$this->model('member')->checklogin('','','','',true);
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return['gettype']=array('1'=>'充值兑换','2'=>'活动赠送','3'=>'朋友赠送');
if($_RQ['op']=='get'){
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
	if($_RQ['isuse']==1){
		$isuse=1;
		$params['isuse']=1;
	}else{
		$isuse=0;
		$params['isuse']=0;
	}
	$return['isuse'] = $isuse ? $isuse :0;
	$pindex = max(1, intval($_RQ['page']));
	if(intval($_RQ['num'])){
		$psize = intval($_RQ['num']);
	}else{
		$psize = 10;
	}
	$total='';
	$list=pdo_getslice('jy_weishop_goodscard_getlog',$params,array($pindex,$psize),$total,$fields,'','lastmoney desc');
	foreach($list as &$v){
		$v['card']=$this->model('goodscard')->intcard($v['cardid'],$v['createtime']);
	}
	$return['list']=$list;
	exi($return);
}
if($_RQ['op']=='detail'){
	$id=intval($_RQ['id']);
	$item=$this->model('goodscard')->getdetail($id);
	$return['item']=$item;
	exi($return);
}